const fontEndQuestionService  = require('../../services/admin/fontEndQuestion')
const sendMsg = require("../../tools/sendMsg"); //引入数据库封装模块

// 请求类型 增加，删除，修改，查询
const fontEndQuestionController = {
    searchFrontEndQuestions: async (req,res)=>{
        const result = await fontEndQuestionService.searchFrontEndQuestions(req.body)
        sendMsg.checkResult(res, result, 4)
    },
    addFrontEndQuestions: async (req,res)=>{
        const result = await fontEndQuestionService.addFrontEndQuestions(req.body)
        sendMsg.checkResult(res, result, 1)
    },
    delFrontEndQuestions: async (req,res)=>{
        const result = await fontEndQuestionService.delFrontEndQuestions(req.body)
        sendMsg.checkResult(res, result, 2)
    },
    updateFrontEndQuestions: async (req,res)=>{
        const result = await fontEndQuestionService.updateFrontEndQuestions(req.body)
        sendMsg.checkResult(res, result, 3)
    },
    getAllType: async (req,res)=>{
        const result = await fontEndQuestionService.getAllType(req.body)
        sendMsg.checkResult(res, result, 4)
    }
}

module.exports = fontEndQuestionController
